package service

import (
	"TD-UI/internal/model"
	"context"
)

type (
	IDb interface {
		CreateDb(ctx context.Context, req model.DbReq) (res model.DbRes, err error)
		Dbddl(ctx context.Context, req model.DbDdlReq) (res model.DbRes, err error)
		DbDel(ctx context.Context, req model.DbDelReq) (res model.DbRes, err error)
	}
)

var (
	localDb IDb
)

func Db() IDb {
	if localLink == nil {
		panic("implement not found for interface IDb, forgot register?")
	}
	return localDb
}

func RegisterDb(i IDb) {
	localDb = i
}
